<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../static/lib/vue/vue3.1.1.js"></script>
    <style>
        .static {
            width: 100px;
            height: 100px;
        }
        .active {
            background: green;
        }
        .text-danger {
            background: red;
        }
    </style>
</head>
<body>

<div id="app">
    <div class="static" :class="{'active' : isActive, 'text-danger': hasError }"></div>
    <div class="static" :class="classObject"></div>
    <div :style="{ color: activeColor, fontSize: fontSize + 'px' }">菜鸟教程</div>
</div>


<script>

    const app = Vue.createApp({
        data() {
            return {
                isActive: false,
                hasError: true,
                classObject: {
                  active: true,
                },
                activeColor: 'red',
                fontsize: 30,
            }
        },
    }).mount('#app')

</script>
</body>
</html>